package com.api.wall.like;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = "classpath:/wall/wall-inbox.xml")
public class LikeExternal extends AbstractApiTest {

	@Value("#{org_inboxwall[external].appId}")
	private String userUrn;

	@Value("#{org_inboxwall[external].password}")
	private String userPassword;

	@Value("#{org_inboxwall[contact].eventUrn}")
	private String eventUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test(expectedExceptions = ZyncroApiException.class)
	public void testLike() throws ZyncroApiException {

		String result = getApi().getService(IWallApiService.class).like(eventUrn);

		Assert.assertNotNull(result);
	}
}
